Hands On: Creating a New Report

To help you quickly create professional-quality reports, Seagate Crystal Reports includes Report Experts that walk you through the report generation process step-by-step, giving you "paint-by-number" solutions to complex reporting problems. In most cases, Report Experts present you with a series of tabs. Each tab requests information about one aspect of the reporting process. You work through the tabs, selecting only those tabs necessary for the reporting task at hand. When the final tab is completed, the Report Expert generates the report.

In this example, you will create a simple report that show total sales by region for a fictitious bicycle company called Xtreme.

Step by step

1 Open Seagate Crystal Reports 7, if it is not already running.
2 To create a new report, select  New... from the  File menu. The Report Gallery window will appear.
3 Click on the Standard button. The Create Report Expert window will appear with a series of tabs. This initial Data tab allows you to select the method used to connect to your source of data.
4 You will be connecting to an existing Access database file so click on the Data File button. The Choose Database File window will appear. Select the file named "xtreme" from the list of files and click Add.
5 Now that you’ve specified the source of the data, the Select Tables dialog box appears. We're only interested in using one table for this simple report, so select "Customer" from the list and click OK. Click Done to close the Choose Database File dialog box. You’ll return to the Create Report Expert window. Now that you’ve selected the database and the table for your report, you’ll need to specify the fields you want to include in the report.
6 Click on the Fields tab and select the "Customer Name" database field in the Database Fields text box. Click and drag the field into the Report Fields text box. Do the same for the "Last Year’s Sales", "City" and "Region" fields.

The Report Expert creates column headers for you using the field names as a default. If you want to rename a column, simply type the new name in the corresponding column header field.

7

Click on the Preview Report button to view the report so far. Passing your mouse pointer over the various report objects will display information about that object in a ToolTip which is the small yellow box which pops up next to your mouse pointer. You can see the actual database field names displayed when you pass the pointer over some of the report fields.

You've now quickly created a basic report which has the core sales information for all customers. Now we'll alter the report to make it more specific and easier to read.


Manipulating Data
Now that you’ve created a basic report, you can manipulate the data to modify the report any way you want. You may want to filter data to include only those customers in a certain country, for example, or you may need to present subtotals in a certain order, list companies by region, or highlight certain totals according to their amounts.

To use the Report Expert to help make these changes, select Report Expert... from the Report menu. A Confirm Command dialog box will pop up, click Yes and the Report Expert will appear.
8 Let's sort the report data geographically. Click on the Sort tab and drag the "Region" and "City" fields into the Sort Fields text box. Select in ascending order if not already visible in the Order drop-down box.
9 We want to show the total sales for each group on our report so click on the Total tab. Because The "Last Years Sales" field is the only numeric field in the report, the expert automatically selected it for totaling.
10 For this report, we will only show the overall top sales performers so click on the TopN tab. The Report Expert automatically selects sum of "Last Year’s Sales" and Top 5. We'll accept the defaults as shown.

create_06.jpg (32046 bytes)

11 We'll focus the report further by choosing only customers in the USA for this report. Click on the Select tab, highlight the "Country" field and drag it into the Select Fields text box. Select "equal to" in the second drop-down box and "USA" in the third drop-down box. This will exclude all records from the report where the country field does not match USA.

create_07.jpg (37878 bytes)


Adding a Graph
Seagate Crystal Reports contains a powerful graphing tool that converts data into graphs so you can include intuitive, presentation-quality graphs in any report. These graphs can be completely customized and they can be inserted almost anywhere in your report. Simply select the style of graph you want and the Report Export automatically creates it for you.
12 We'll now add a graph that represents the regional subtotals of the sales figures as a percentage of the total sales in the USA. Click on the Graph tab and click on the Pie button in the Graph Gallery. Select the Regular pie with 3D visual effect and click on the Data tab. The Report Expert automatically creates the graph based on the sum of "Last Year’s Sales".

Adding a Style
To make your report more appealing, you can add a variety of elements such as borders, underlines, and logos. By using the style features in the Create Report Expert, you can add style attributes to any report.
13 To add a style to this report, click on the Style tab and select the Red/Blue Border style. We'll take this opportunity to add a title as well by typing "Sales by Region" in the Title field.

create_10.jpg (43757 bytes)

14 Click Preview Report and you will see the modified report complete with graph. Double clicking on one of the pie graph segments will "drill-down" into the sales data display the matching report details for that region. You can also right-click on the graph and select Launch Analyzer to change pie slice colors or make other modifications to the graph. To use this report for the next exercise, you may want to save the report on your system.

This exercise has shown the basic steps in creating a new report. Although you don’t always have to use the Report Experts, they make connecting to your data source and creating the initial report fast and easy. You can then alter the look and feel of the report using the Design window. Common tasks like field formatting, adding text and modifying field positions, can be accomplished through dragging fields around or inserting new ones.


For the latest information about this product, please visit the web site at www.seagatesoftware.com/crystalreports.

Copyright ⌐ 1998 Seagate Software Inc. All rights reserved. Click here for additional information.